try:
    l = ["a", "b"]
    int(l[2])

except (ValueError, IndexError) as e:
    print(f'exception:{e}')  # exception:list index out of range
    print(type(e))  # <class 'IndexError'>
    print(e.args)  # ('list index out of range',)
